/*
 * SQLGrammer.h
 *
 *  Created on: Jun 10, 2010
 *      Author: administrator
 */

#ifndef SQLPARSER_H_
#define SQLPARSER_H_

#include "types/query.h"
#include "modules/Executor.h"
#include "modules/Main.h"
#include "modules/record_mgr.h"
#include "types/record.h"
#include "types/common.h"

using namespace std;

class SQLParser {
private:
	SQL * parseCreateTable(vector<string,allocator<string> > &statement,Executor *validate);
	SQL * parseCreateIndex(vector<string,allocator<string> > &statement,Executor *validate);
	SQL * parseInsert(vector<string,allocator<string> > &statement,Executor *validate);
	SQL * parseSelect(vector<string,allocator<string> > &statement,Executor *validate);
	void parsePrint(vector<string, allocator<string> > &statement);
public:
	SQLParser();
	virtual ~SQLParser();
	SQL * parse(vector<string,allocator<string> > &statement,Executor *validate);
	RecordManager *recmanager;
};

#endif /* SQLGRAMMER_H_ */
